<template>
  <div class="wrapper">
    <v-head></v-head>
    <v-sidebar></v-sidebar>
    <div class="content">
      <transition name="move" mode="out-in"
        ><router-view></router-view>
      </transition>
    </div>
  </div>
</template>

<script>
import vHead from "./header.vue";
import vSidebar from "./sidebar.vue";
import * as commonConst from "../common/commonConst";
export default {
  components: {
    vHead,
    vSidebar
  },

  mounted() {
    document.title = "极简词条管理";

    let userSession = localStorage.getItem(commonConst.userSessionKey);
    //没登录
    if (!userSession) {
      this.$message({
        type: "error",
        message: "你还没有登录"
      });
      //跳转到管理页面
      this.$router.push("login");
    }
  }
};
</script>
